<style>
    .bgwhite th{background-color: #fff;}
    .jqtree-tree .jqtree-btn{background-color: transparent;;}
    .jqtree-btn:hover,.jqtree-tree .jqtree-element:hover .jqtree-btn{background-color: transparent; display: block; }
    /*.jqtree-tree .jqtree-btn{display: none;}*/
    .jqtree-tree .jqtree-btn a{margin-top: 0px;color: #ff7713;}
    .jqtree-tree li.jqtree-selected .jqtree-btn, .jqtree-tree li.jqtree-selected > .jqtree-element .jqtree-tree li.jqtree-selected .jqtree-btn{ display: block !important;}
    #tree_table{  max-height: 450px;min-height: 450px; height: 450px; border: 1px solid #d9d9d9;overflow-y: auto;}
    .jqtree-tree {border-top: 0; }
    .jqtree-tree {border: none;}
    .jqtree-tree .jqtree-element .jqtree-title { width: 90px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; display: inline-block; }
    .import_btn .top-userinfo-menu{display: none;}
    .import_btn:hover .top-userinfo-menu{display: block;}

</style>
<div class="row mt20">
    <div class="col-md-3">
        <div class="table-header clearfix">
            <span class="f14 lh30 text-indent fl">楼栋列表：</span>
            <a href="javascript:;" class="btn fl" ng-click="treeExpand()">{{isExpand===true?'展开':'收起'}}</a>
        </div>
        <div id="tree_table" class="mt10" class="tree_table">

        </div>
    </div>
    <div class="col-md-9">
        <div class="table-header clearfix">
            <input type="text" class="input-text fl mr5 w200 c-gray" ng-enter="fuzzySearch()" placeholder="房间" ng-model="query.room">
            <a href="javascript:;" class="btn"  ng-click="fuzzySearch()">搜索</a>
            <div class="fr btn-group">
                <div class="fl import_btn relative">
                    <button ng-show='bindErp == 0' href="javascript: void(0)" class="btn permission p-0000200104-01-inline-block">导入房间</button>
                    <div class="top-userinfo-menu text-center" style="z-index: 100;top: 25px;left: -7px;">
                        <div class="top-userinfo-menu-list">
                            <a href="javascript:;" ng-click="downloadTemplate()">模版下载</a>
                            <a href="javascript:;"
                               ui-dialog="导入房间"
                               ui-dialog-data=""
                               ng-disabled="canEdit==0"
                               ui-dialog-before-show="beforeUploadRoom($dialog,$dialogScope,$data)"
                               ui-dialog-show="uploadRoom($dialog)"
                               ui-cancel-value="取消"
                               ui-dialog-cache="false"
                               ui-dialog-url="inc/dialog/upload_room.html">导入房间</a>
                        </div>
                        <i class="top-userinfo-menu-arrow"></i>
                    </div>
                </div>
                <button ng-show='bindErp == 0' href="javascript: void(0)" class="btn permission p-0000200104-02-inline-block"
                   ui-dialog="设置房间状态"
                   ui-dialog-data=""
                   ui-dialog-before-show="setInitRoomStatus($data)"
                   ui-dialog-ok="changeRoomStatus($data)"
                   ui-dialog-cache="false"
                   ng-disabled="canEdit==0"
                   ui-dialog-url="inc/dialog/change_room_status.html">设置状态</button>
                <button ng-show='bindErp == 0' href="javascript: void(0)" ng-disabled="canEdit==0" class="btn btn-yellow permission p-0000200104-03-inline-block" ng-click="deleteRooms()">删除</button>
            </div>
        </div>
        <div class="table-wrap mt10 lh24" style="min-height: 450px;">
            <table width="100%">
                <thead>
                <tr>
                    <th colspan="10">
                        <a class="fl mr15">房间状态：</a>
                        <a class="fl mr15" ng-class="{'c-orange':query.roomStatus==''}" ng-click="changeQueryRoomStatus('')">全部</a>
                        <a class="fl mr15"  ng-class="{'c-orange':query.roomStatus=='1'}" ng-click="changeQueryRoomStatus('1')">未放盘</a>
                        <a class="fl mr15"  ng-class="{'c-orange':query.roomStatus=='2'}" ng-click="changeQueryRoomStatus('2')">未售</a>
                        <a class="fl mr15"  ng-class="{'c-orange':query.roomStatus=='3'}" ng-click="changeQueryRoomStatus('3')">已售</a>
                        <a class="fl mr15"  ng-class="{'c-orange':query.roomStatus=='4'}" ng-click="changeQueryRoomStatus('4')">预销控</a>
                        <a class="fr mr15 c-orange" ng-click="search()"><i class="freshen"></i></a>
                    </th>
                </tr>
                <tr class="bgwhite">
                    <th width="30">
                        <label class="checkbox">
                            <input type="checkbox"  ng-model="checkedRooms">
                            <span>&nbsp</span>
                        </label>
                    </th>
                    <th width="200">房间</th>
                    <th width="100">房间状态</th>
                    <th width="120">房间结构</th>
                    <th width="80">朝向</th>
                    <th width="120">面积(㎡)</th>
                    <th width="140">单价(元)</th>
                    <th width="80">标准总价(元)</th>
                </tr>
                </thead>
                <tbody>
                <tr ng-repeat="room in rooms">
                    <td height="40">
                        <label class="checkbox">
                            <input type="checkbox" id="cb2" value="1" name="cb1" ng-model="room.checked">
                            <span>&nbsp</span>
                        </label>
                    </td>
                    <td>
                        <p ng-show="canEdit==1 && permissionRoomUpdate && bindErp == 0">
                            <a href="javascript:;"
                               ui-dialog="编辑房间"
                               ui-dialog-data="room"
                               ui-dialog-before-show="beforeUpdateRoom($dialogScope)"
                               ui-dialog-show="showUpdateRoom($dialogScope,$dialog)"
                               ui-dialog-ok="editRoom($data)"
                               ui-dialog-cache="false"
                               ui-dialog-url="inc/dialog/edit_room.html" class="c-orange">{{room.roomInfo}}</a>
                        </p>
                        <p ng-show="!(canEdit==1 && permissionRoomUpdate && bindErp == 0)">{{room.roomInfo}}</p>
                    </td>
                    <td>
                        <p>{{room.room_statusText}}</p>
                    </td>
                    <td>{{room.room_stru}}</td>
                    <td>{{room.west}}</td>
                    <td>
                        <p>建筑：{{room.bld_area }}</p>
                        <p>套内：{{room.tn_area }}</p>
                    </td>
                    <td>
                        <p style="white-space: nowrap;">建筑：{{room.price | number:2 }}</p>
                        <p style="white-space: nowrap;">套内：{{room.tn_price | number:2 }}</p>
                    </td>
                    <!--
                    <td>{{room.bld_area }}</td>
                    <td>{{room.tn_area }}</td>
                    <td>{{room.price }}</td>
                    <td>{{room.tn_price }}</td>
                    -->
                    <td>{{room.total | number:2 }}</td>
                </tr>

                </tbody>
            </table>
            <div class="tab_loading" ng-if="loading"><span>加载中...</span></div>
            <div class="no-data" ng-show="!loading && rooms.length==0"><span>暂无数据</span></div>
        </div>
        <p class="mt15">
            <span class="c-orange">各状态房间占比说明：</span>
            未放盘：{{statistics.wfp}}套，占{{statistics['wfp-pec']}}%;   未售：{{statistics.ws}}套，占{{statistics['ws-pec']}}%;   已售：{{statistics.ys}}套，占{{statistics['ys-pec']}}%;   预销控：{{statistics.yxk}}套，占{{statistics['yxk-pec']}}%
        </p>
        <div ui-pagination page-index="query.pageIndex" page-size="query.pageSize" total="query.total" changed="changedPage($pageIndex)"></div>
    </div>
</div>
<div  class="loading ng-hide" style="top:270px;">
    <div class="loading-con">
        <div class="loading-img">
            <i class="loading-prompt"></i>
        </div>
        <p>该楼栋下存在房间，不能删除</p>
    </div>
</div>